package Demo;

import java.util.Scanner;

public class Sum_day {
    public static void main(String[] args) {

        int[] arr = new int[] {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年：");
        int year = scanner.nextInt();
        System.out.println("请输入月：");
        int month = scanner.nextInt();
        System.out.println("请输入日：");
        int day = scanner.nextInt();
        int sum = 0;
        sum += day;
        for (int i = 0; i < month - 1; i++) {
            sum += arr[i];
        }
        if((year % 4 == 0 && year % 100 != 0 || year % 400 == 0) && month >= 2) {
            sum += 1;
        }
        System.out.println("这是" + year + "年第" + sum + "天");
    }
}
